#ifndef LUAFILE_H
#define LUAFILE_H

#include <string>
#include <QString>
#include "../lua_parser/LuaParser.h"
using namespace std;

class LuaToken;

class LuaFile : public LuaParser
{
    QString m_path;
    QString m_content;
    bool m_isSaved;
    int m_scrollOffset;
public:
    LuaFile(QString aPath);
    ~LuaFile();
    QString getPath();
    void setContent(QString aContent);
    void reloadFromFileSystem(GlobalSink *aSink);
    TokenParser * getTokenParser();
    QString getText();
    void addMatchingLocals(int aOffset, QString aMatch, QStringList &aList);
    void save();
    bool isSaved();
    bool hasGlobal(const QString &aText);
    void addMatchingGlobals(QString aMatch, QStringList &aList);
    bool getParameterForToken(LuaToken * aToken, LuaToken ** aParameter);
    bool hasGlobalMethod(const QString aText);    
    int getScrollOffset();
    void setScrollOffset(int aOffset);
    void getAllGlobalFunctions(QStringList &aSink);
    void getAllLocalFunctions(QStringList &aSink);
    int getOffsetByFunctionHeader(QString aHeader);
};

#endif // LUAFILE_H
